package com.okq.service.Impl;

import com.okq.dao.JobProductDao;
import com.okq.entity.JobChart;
import com.okq.entity.JobProduct;
import com.okq.service.IJobProductService;
import com.okq.util.page.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 描述 : 工单产品接口实现类
 * 作者 : zdl
 * 日期 : 2017/6/29 11:05
 */
@Transactional
@Service
public class JobProduceServiceImpl implements IJobProductService {

    @Autowired
    private JobProductDao jobProductDao;

    @Override
    public void saveJobProduct(JobProduct jobProduct) {
        jobProductDao.saveJobProduct(jobProduct);
    }

    @Override
    public void deleteJobProduct(JobProduct jobProduct) {
        jobProductDao.deleteJobProduct(jobProduct);
    }

    @Override
    public void updateJobProduct(JobProduct jobProduct) {
        jobProductDao.updateJobProduct(jobProduct);
    }

    @Override
    public void saveOrUpdateJobProduct(JobProduct jobProduct) {
        jobProductDao.saveOrUpdateJobProduct(jobProduct);
    }

    @Override
    public JobProduct getJobProductById(String id) {
        return jobProductDao.getJobProductById(id);
    }

    @Override
    public List<JobProduct> listAllJobProduct() {
        return jobProductDao.listAllJobProduct();
    }

    @Override
    public Page<JobProduct> pageByJobProduct(Page<JobProduct> page, JobProduct jobProduct) {
        return jobProductDao.pageByJobProduct(page, jobProduct);
    }

    @Override
    public List<JobProduct> listJobProductByJid(String jobId) {
        return jobProductDao.listJobProductByJid(jobId);
    }

    @Override
    public List<JobProduct> listJobProductByPid(String jobId) {
        return jobProductDao.listJobProductByPid(jobId);
    }


    @Override
    public List<JobChart> listJobByCondition(JobProduct jobProduct) {
        return jobProductDao.listJobByCondition(jobProduct);
    }
}
